#
#  Be sure to run `pod spec lint ios-swift-imbroker.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |spec|

# spec的名字，同podfile中指定依赖的名字一致。
spec.name         = "ios-swift-live"
# 版本号，同podfile中指定依赖的版本号一致。
spec.version      = "1.0.3"
spec.summary      = "直播SDK"

# 描述，一般要比summary长度长些，否则pod lint时会有警告。非强制性。
spec.description  = <<-DESC
直播liveSDK
DESC
# 主页地址，一般指向github地址即可
spec.homepage     = "http://gitcode.tongdao.cn/dev28/framework/ios/ios-swift-live.git"
# 截图，一般不需要
# spec.screenshots  = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
# 许可证，一般为MIT或BSD 3-clause,默认MIT即可
spec.license      = "MIT"
# 指定许可证的另一种方式
# spec.license      = { :type => "MIT", :file => "FILE_LICENSE" }
# 作者介绍 左边为名字，邮编为联系方式或者主页
spec.author             = { "xuwc" => "xuwc@liepin.com" }
# 指定使用系统平台
# spec.platform     = :ios
# 指定使用系统平台以及系统版本号
spec.platform     = :ios, "9.0"
# 是否采用arc，一般默认为true
spec.requires_arc = true
# 指定经爱哭使用方式，一般swift必须指定该项为true
spec.static_framework = true
# 指定swift版本号
spec.swift_version = '5.0'
# 指定module名字，一般swift使用时必须指定,注意不能使用-，要改为下划线_
spec.module_name   = 'ios_swift_live'

# 当使用多个平台时，可如下指定，一共就4个平台。ios,osx,watchos,tvos
# spec.ios.deployment_target = "5.0"
# spec.osx.deployment_target = "10.7"
# spec.watchos.deployment_target = "2.0"
# spec.tvos.deployment_target = "9.0"

# 指定核心依赖库，开启后，仅加载指定的子库
# spec.default_subspecs = 'Core', 'UI'
spec.default_subspecs = 'tx'

# 下载资源远程仓库路径，tag为版本号，可手动指定，也可与spec版本保持一致。
spec.source       = { :git => "http://gitcode.tongdao.cn/dev28/framework/ios/ios-swift-live.git", :tag => "#{spec.version}" }
# 类资源文件，为ios-swift-tools.git根目录算起,一般为这样设置即可
spec.source_files  = "classes/*"
# 非下载的文件集合，一般用于readme.md等无需下载的资源使用
#spec.exclude_files = "classes/Exclude"

# 对外开放的头文件
spec.public_header_files = "classes/ios_swift_live.h"
# 私有文件，不暴露给外界使用
#spec.private_header_files = "classes/imbroker/*.h"

# 资源文件路径，此资源被直接使用
# spec.resource  = "icon.png"
# spec.resources = "Resources/**/*.png"

# 资源文件指定，会被打包成bundle文件，使用资源时需要指定bundle名字, 一般采用这种
# spec.resource_bundles = {
#     'ios-swift-tools' => ['Resources/**/*]
# }

# spec.preserve_paths = "FilesToSave", "MoreFilesToSave"

# 系统动态库依赖方式
# spec.framework  = "SomeFramework"
# spec.frameworks = "SomeFramework", "AnotherFramework"

# 系统静态库依赖方式
# spec.library   = "iconv"
# spec.libraries = "iconv", "xml2"

# 本地提供的静态库依赖方式
# spec.vendored_libraries = "classes/**/*.a"

# 本地提供的动态库依赖方式
# subspec.ios.vendored_frameworks = "classes/**/*.framework"

# 修改工程配置
# spec.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }

# 依赖其他第三方库
# spec.dependency "JSONKit", "~> 1.4"

# oc与swift混编，提供预编译头文件引用。
# spec.prefix_header_contents = '#import "xxx.h"', '#import <UIKit/UIKit.h>'
  # spec.pod_target_xcconfig = {
  #   'OTHER_LDFLAGS' => '-ObjC'
  # }

# *******
# 将oc文件开放给swift使用，需要在classes类下面创建ios_swift_imbroker.h空文件，否则swift将无法找到该方法
# *******
 # if ENV['is_source']
 #    puts '-------------------------------------------------------------------'
 #    puts 'Notice:ios-swift-ad is source now' 
 #    puts '-------------------------------------------------------------------'
    # 子库创建方式


spec.resource_bundles = {
 'ios-swift-live' => ['assets/**/*.{png,plist}']
}

spec.subspec 'core' do | core |
	core.source_files = 'classes/*.{h,m}'
	core.public_header_files = "classes/ios_swift_live.h"
end

spec.subspec 'tx' do | tx |
	tx.dependency 'ios-swift-live/txvod'
	tx.dependency 'ios-swift-live/txcdn'
	tx.dependency 'ios-swift-live/txrtc'
	tx.dependency 'ios-swift-live/roommanager'
	tx.dependency 'ios-swift-live/common'
end

spec.subspec 'common' do | common |
	common.source_files = 'classes/tx/common/*.{swift}'
end

spec.subspec 'txcdn' do | txcdn |
	txcdn.source_files = 'classes/tx/txcdn/*.{swift}'
	txcdn.subspec 'entity' do | entity |
		entity.source_files = 'classes/tx/txcdn/entity/*.{swift}'
	end
	txcdn.subspec 'internal' do | internal |
		internal.source_files = 'classes/tx/txcdn/internal/*.{swift}'
	end
	txcdn.dependency 'TXLiteAVSDK_Professional','7.2.8932'
	txcdn.dependency 'ios-swift-live/livelog'
	txcdn.dependency 'ios-swift-tools'
	txcdn.dependency 'ios-swift-live/common'
end

spec.subspec 'txrtc' do | txrtc |
	txrtc.source_files = 'classes/tx/txrtc/*.{swift}'
	txrtc.subspec 'entity' do | entity |
		entity.source_files = 'classes/tx/txrtc/entity/*.{swift}'
	end
	txrtc.subspec 'internal' do | internal |
		internal.source_files = 'classes/tx/txrtc/internal/*.{swift}'
	end
	txrtc.dependency 'TXLiteAVSDK_Professional','7.2.8932'
	txrtc.dependency 'ios-swift-live/common'
end

spec.subspec 'txvod' do | txvod |
	txvod.source_files = 'classes/tx/txvod/*.{swift}'
	txvod.subspec 'entity' do | entity |
		entity.source_files = 'classes/tx/txvod/entity/*.{swift}'
	end
	txvod.subspec 'internal' do | internal |
		internal.source_files = 'classes/tx/txvod/internal/*.{swift}'
	end
	txvod.dependency 'TXLiteAVSDK_Professional','7.2.8932'
	txvod.dependency 'ios-swift-tools'
	txvod.dependency 'ios-swift-live/common'
end

spec.subspec 'txvoddownload' do | txvoddownload |
	txvoddownload.source_files = 'classes/tx/txvoddownload/*.{swift}'
	txvoddownload.dependency 'TXLiteAVSDK_Professional','7.2.8932'
end

spec.subspec 'txvodupload' do | txvodupload |
	txvodupload.dependency 'ios-swift-live/core'
	txvodupload.source_files = 'classes/tx/txvodupload/*.{swift}'
	txvodupload.subspec 'internal' do | internal |
		internal.source_files = 'classes/tx/txvodupload/internal/*.{swift}'
	end
	txvodupload.subspec 'upload' do |upload|
		upload.source_files = 'classes/tx/txvodupload/upload/*.{h,m}'
		# upload.private_header_files = 'classes/tx/txvodupload/upload/**/*.{h}'
		upload.public_header_files = 'classes/tx/txvodupload/upload/*.{h}'
		upload.subspec 'include' do | include |
			include.source_files = 'classes/tx/txvodupload/upload/include/*.{h,m}'
		end
		upload.dependency 'QCloudCore', '5.8.2'
		upload.dependency 'QCloudCOSXML','5.8.2'

  		# upload.ios.vendored_frameworks = 'classes/tx/txvodupload/upload/COSSDK/QCloudCore.framework','classes/tx/txvodupload/upload/COSSDK/QCloudCOSXML.framework'
    	# upload.ios.vendored_libraries = 'classes/tx/txvodupload/upload/COSSDK/libmtasdk.a'
    	upload.frameworks = 'CoreTelephony','Foundation','SystemConfiguration'
   		upload.libraries = "c++"
	end

	txvodupload.dependency 'TXLiteAVSDK_Professional','7.2.8932'
	txvodupload.dependency 'ios-swift-httpclient'
	txvodupload.dependency 'ios-swift-live/common'
end

spec.subspec 'txim' do | txim |
	txim.source_files = 'classes/tx/txim/*.{swift}'
	txim.dependency 'TXIMSDK_iOS' ,'4.8.10'
	txim.dependency 'ios-swift-tools'
end

spec.subspec 'roommanager' do | roommanager |
	roommanager.source_files = 'classes/tx/roommanager/*.{swift}'
	roommanager.subspec 'entity' do | entity |
		entity.source_files = 'classes/tx/roommanager/entity/*.{swift}'
		entity.subspec 'body' do | body |
			body.source_files = 'classes/tx/roommanager/entity/body/*.{swift}'
		end
		entity.subspec 'model' do | model |
			model.source_files = 'classes/tx/roommanager/entity/model/*.{swift}'
		end
	end
	roommanager.subspec 'internal' do | internal |
		internal.source_files = 'classes/tx/roommanager/internal/*.{swift}'
		internal.subspec 'httpProxy' do | httpProxy |
			httpProxy.source_files = 'classes/tx/roommanager/internal/httpProxy/*.{swift}'
		end
	end
	roommanager.dependency 'ios-swift-live/txim'
	roommanager.dependency 'ios-swift-httpclient'
	roommanager.dependency 'ios-swift-live/lpnetspeed'
	roommanager.dependency 'ios-swift-live/common'
end

spec.subspec 'txsample' do | txsample |
	txsample.source_files = 'classes/tx/sample/*.{swift}'
	txsample.dependency 'SnapKit'
	txsample.dependency 'ios-swift-base'
	txsample.dependency 'ios-swift-tools'
end

spec.subspec 'alicdn' do | alicdn |
	alicdn.source_files = 'classes/aliplayer/alicdn/*.{swift}'
	alicdn.subspec 'entity' do | entity |
		entity.source_files = 'classes/aliplayer/alicdn/entity/*.{swift}'
	end
	alicdn.subspec 'internal' do | internal |
		internal.source_files = 'classes/aliplayer/alicdn/internal/*.{swift}'
	end
	alicdn.dependency 'AliPlayerSDK_iOS','5.1.2'
end

spec.subspec 'alivod' do | alivod |
	alivod.source_files = 'classes/aliplayer/alivod/*.{swift}'
	alivod.subspec 'entity' do | entity |
		entity.source_files = 'classes/aliplayer/alivod/entity/*.{swift}'
	end
	alivod.subspec 'internal' do | internal |
		internal.source_files = 'classes/aliplayer/alivod/internal/*.{swift}'
	end
	alivod.dependency 'AliPlayerSDK_iOS','5.1.2'
end

spec.subspec 'alivoddownload' do | alivoddownload |
	alivoddownload.source_files = 'classes/aliplayer/alivoddownload/*.{swift}'
	alivoddownload.dependency 'AliPlayerSDK_iOS','5.1.2'
end

spec.subspec 'lpcdn' do | lpcdn |
	lpcdn.source_files = 'classes/commonplayer/lpcdn/*.{swift}'
	lpcdn.subspec 'entity' do | entity |
		entity.source_files = 'classes/commonplayer/lpcdn/entity/*.{swift}'
	end
	lpcdn.subspec 'internal' do | internal |
		internal.source_files = 'classes/commonplayer/lpcdn/internal/*.{swift}'
	end
	lpcdn.dependency 'ios-swift-live/txcdn'
	lpcdn.dependency 'ios-swift-live/alicdn'
	lpcdn.dependency 'ios-swift-live/lpcommon'
end

spec.subspec 'lpvod' do | lpvod |
	lpvod.source_files = 'classes/commonplayer/lpvod/*.{swift}'
	lpvod.subspec 'entity' do | entity |
		entity.source_files = 'classes/commonplayer/lpvod/entity/*.{swift}'
	end
	lpvod.subspec 'internal' do | internal |
		internal.source_files = 'classes/commonplayer/lpvod/internal/*.{swift}'
	end
	lpvod.dependency 'ios-swift-live/txvod'
	lpvod.dependency 'ios-swift-live/alivod'
	lpvod.dependency 'ios-swift-live/lpcommon'

end

spec.subspec 'lpcommon' do | lpcommon |
	lpcommon.source_files = 'classes/commonplayer/common/*.{swift}'
end

spec.subspec 'commonplayer' do | commonplayer |
	commonplayer.dependency 'ios-swift-live/lpvod'
	commonplayer.dependency 'ios-swift-live/lpcdn'
	commonplayer.dependency 'ios-swift-live/lpcommon'
end

spec.subspec 'commonplayersample' do | commonplayersample |
	commonplayersample.source_files = 'classes/commonplayer/commonplayersample/*.{swift}'
	commonplayersample.dependency 'ios-swift-live/commonplayer'
	commonplayersample.dependency 'SnapKit'
	commonplayersample.dependency 'ios-swift-base'
	commonplayersample.dependency 'ios-swift-tools'
end

spec.subspec 'barrage' do | barrage |
	barrage.source_files = 'classes/barrage/*.{swift}'
	barrage.subspec 'entity' do | entity |
		entity.source_files = 'classes/barrage/entity/*.{swift}'
	end
	barrage.subspec 'internal' do | internal |
		internal.source_files = 'classes/barrage/internal/*.{swift}'
	end
	barrage.dependency 'ios-swift-tools'
end

spec.subspec 'barragesample' do | barragesample |
	barragesample.source_files = 'classes/barragesample/*.{swift}'
	barragesample.dependency 'ios-swift-live/barrage'
	barragesample.dependency 'ios-swift-base'
end

spec.subspec 'livelog' do | livelog |
	livelog.source_files = 'classes/livelog/*.{swift}'
	livelog.subspec 'internal' do | internal |
		internal.source_files = 'classes/livelog/internal/*.{swift}'
	end
	livelog.dependency 'ios-swift-base'
	livelog.dependency 'ios-swift-httpclient'
	livelog.dependency 'ios-swift-live/common'
end
spec.subspec 'lpnetspeed' do | lpnetspeed |
	lpnetspeed.source_files = 'classes/lpnetspeed/*.{swift}'
	lpnetspeed.subspec 'internal' do | internal |
		internal.source_files = 'classes/lpnetspeed/internal/*.{swift}'
	end
	lpnetspeed.dependency 'ios-swift-base'
	lpnetspeed.dependency 'ios-swift-httpclient'
end

spec.subspec 'rtccommon' do | rtccommon |
	rtccommon.source_files = 'classes/rtccommon/*.{swift}'
	rtccommon.subspec 'internal' do | internal |
		internal.source_files = 'classes/rtccommon/internal/*.{swift}'
		internal.subspec 'event' do | event |
			event.source_files = 'classes/rtccommon/internal/event/*.{swift}'
		end
		internal.subspec 'httpProxy' do | httpProxy |
			httpProxy.source_files = 'classes/rtccommon/internal/httpProxy/*.{swift}'
		end
	end

	rtccommon.subspec 'entity' do | entity |
		entity.source_files = 'classes/rtccommon/entity/*.{swift}'
	end
	rtccommon.dependency 'ios-swift-base'
	rtccommon.dependency 'ios-swift-httpclient'
	rtccommon.dependency 'ios-swift-live/common'
	rtccommon.dependency 'TXLiteAVSDK_Professional','7.2.8932'
	rtccommon.dependency 'AgoraRtcEngine_iOS','2.9.0.105'
end

spec.subspec 'rtcsample' do | rtcsample |
	rtcsample.source_files = 'classes/rtcsample/*.{swift}'
	rtcsample.dependency 'SnapKit'
	rtcsample.dependency 'ios-swift-base'
	rtcsample.dependency 'ios-swift-tools'
	rtcsample.dependency 'ios-swift-live/rtccommon'
end

spec.frameworks = 'UIKit'
spec.dependency 'MJExtension','3.2.1'

end

